
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>

<HEAD>
   <TITLE>sct2e_c</TITLE>
</HEAD>

<BODY style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<A name="TOP"></A>

<table style="text-align: left; margin-left: auto; margin-right: auto; width: 800px;"
 border="0" cellpadding="5" cellspacing="2">
  <tbody>
    <tr>
      <td style="background-color: rgb(153, 153, 153); vertical-align: middle; text-align: center;">
      <div align="right"> 
      <small><small><a href="index.html">Index Page</a></small></small>
      </div>
      <b>sct2e_c</b> </td>
    </tr>

    <tr>
      <td style="vertical-align: top;">

<small><div align="center">
<A HREF="index.html#A">A</A>&nbsp;
<A HREF="index.html#B">B</A>&nbsp;
<A HREF="index.html#C">C</A>&nbsp;
<A HREF="index.html#D">D</A>&nbsp;
<A HREF="index.html#E">E</A>&nbsp;
<A HREF="index.html#F">F</A>&nbsp;
<A HREF="index.html#G">G</A>&nbsp;
<A HREF="index.html#H">H</A>&nbsp;
<A HREF="index.html#I">I</A>&nbsp;
<A HREF="index.html#J">J</A>&nbsp;
<A HREF="index.html#K">K</A>&nbsp;
<A HREF="index.html#L">L</A>&nbsp;
<A HREF="index.html#M">M</A>&nbsp;
<A HREF="index.html#N">N</A>&nbsp;
<A HREF="index.html#O">O</A>&nbsp;
<A HREF="index.html#P">P</A>&nbsp;
<A HREF="index.html#Q">Q</A>&nbsp;
<A HREF="index.html#R">R</A>&nbsp;
<A HREF="index.html#S">S</A>&nbsp;
<A HREF="index.html#T">T</A>&nbsp;
<A HREF="index.html#U">U</A>&nbsp;
<A HREF="index.html#V">V</A>&nbsp;
<A HREF="index.html#W">W</A>&nbsp;
<A HREF="index.html#X">X</A>&nbsp;
</div></small>
       <br>
       <table style="text-align: left; width: 60%; margin-left: auto; margin-right: auto;"
       border="0" cellspacing="2" cellpadding="2">
        <tbody>
          <tr>
            <td style="width: 50%; text-align: center;">
            <small>
              <a href="#Procedure">Procedure<br></a>
              <a href="#Abstract">Abstract<br></a>
              <a href="#Required_Reading">Required_Reading<br></a>
              <a href="#Keywords">Keywords<br></a>
              <a href="#Brief_I/O">Brief_I/O<br></a>
              <a href="#Detailed_Input">Detailed_Input<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Detailed_Output">Detailed_Output<br></a>
              <a href="#Parameters">Parameters<br></a>
              <a href="#Exceptions">Exceptions<br></a>
              <a href="#Files">Files<br></a>
              <a href="#Particulars">Particulars<br></a>
              <a href="#Examples">Examples<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Restrictions">Restrictions<br></a>
              <a href="#Literature_References">Literature_References<br></a>
              <a href="#Author_and_Institution">Author_and_Institution<br></a>
              <a href="#Version">Version<br></a>
              <a href="#Index_Entries">Index_Entries<br></a>
             </small>
            </td>
          </tr>
        </tbody>
</table>

<h4><a name="Procedure">Procedure</a></h4>
<PRE>
   void sct2e_c ( SpiceInt       sc, 
                  SpiceDouble    sclkdp, 
                  SpiceDouble  * et     ) 
</PRE>
<h4><a name="Abstract">Abstract</a></h4>
<PRE>
 
   Convert encoded spacecraft clock (`ticks') to ephemeris 
   seconds past J2000 (ET). 
 </PRE>
<h4><a name="Required_Reading">Required_Reading</a></h4>
<PRE>
 
   <a href="../req/sclk.html">SCLK</a> 
   <a href="../req/time.html">TIME</a> 
 </PRE>
<h4><a name="Keywords">Keywords</a></h4>
<PRE>
 
   CONVERSION 
   TIME 
 

</PRE>
<h4><a name="Brief_I/O">Brief_I/O</a></h4>
<PRE>
 
   Variable  I/O  Description 
   --------  ---  -------------------------------------------------- 
   sc         I   NAIF spacecraft ID code. 
   sclkdp     I   SCLK, encoded as ticks since spacecraft clock 
                  start. 
   et         O   Ephemeris time, seconds past J2000. 
 </PRE>
<h4><a name="Detailed_Input">Detailed_Input</a></h4>
<PRE>
 
   sc             is a NAIF integer code for a spacecraft, one of 
                  whose encoded clock values is represented by 
                  sclkdp. 
 
   sclkdp         is an encoded spacecraft clock value.  sclkdp 
                  represents time measured from spacecraft clock 
                  start:  partition information IS reflected in the 
                  encoded value. 
 </PRE>
<h4><a name="Detailed_Output">Detailed_Output</a></h4>
<PRE>
 
   et             is the epoch, specified as ephemeris seconds past 
                  J2000, that corresponds to sclkdp. 
 </PRE>
<h4><a name="Parameters">Parameters</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Exceptions">Exceptions</a></h4>
<PRE>
 
   1)  This routine assumes that that an SCLK kernel appropriate 
       to the spacecraft clock identified by the input argument sc 
       has been loaded.  If an SCLK kernel has not been loaded, 
       does not contain all of the required data, or contains 
       invalid data, error diagnoses will be performed by routines 
       called by this routine.  The output argument et will not be 
       modified. 
 
   2)  When using SCLK kernels that map SCLK to a time system other 
       than ET (also called barycentric dynamical time---`TDB'), it 
       is necessary to have a leapseconds kernel loaded at the time 
       this routine is called.  If a leapseconds kernel is required 
       for conversion between SCLK and ET but is not loaded, the 
       error will be diagnosed by routines called by this routine. 
       The output argument et will not be modified. 
 
       The time system that an SCLK kernel maps SCLK to is indicated 
       by the variable SCLK_TIME_SYSTEM_nn in the kernel, where nn 
       is the negative of the NAIF integer code for the spacecraft. 
       The time system used in a kernel is TDB if and only if the 
       variable is assigned the value 1. 
 
 
   3)  If the clock type for the spacecraft clock identified by 
       sc is not supported by this routine, the error 
       SPICE(NOTSUPPORTED) is signalled.  The output argument et 
       will not be modified. 
 
   4)  If the input argument sclkdp is invalid, the error will be 
       diagnosed by routines called by this routine.  The output 
       argument et will not be modified. 
 </PRE>
<h4><a name="Files">Files</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Particulars">Particulars</a></h4>
<PRE>
 
   This routine operates on encoded SCLK values.  These values 
   are obtained by calling the CSPICE routine <a href="scencd_c.html">scencd_c</a> or other 
   SCLK conversion routines.  The advantage of encoded SCLK, as 
   opposed to character string representations of SCLK is that 
   encoded SCLK values are easy to perform arithmetic operations on. 
   Additionally, working with encoded SCLK reduces the overhead of 
   repeated conversion of character strings to integers or double 
   precision numbers. 
 
   To convert a string representation of an SCLK value to ET, use 
   the CSPICE routine <a href="scs2e_c.html">scs2e_c</a>. 
 </PRE>
<h4><a name="Examples">Examples</a></h4>
<PRE>
 
   1)  Encode a Galileo SCLK string, and convert the encoded value 
       to ET; use these time values to look up both GLL orbiter 
       scan platform's pointing and the GLL--Earth state vector 
       for an epoch specified by an SCLK string. 
 
          During program initialization, load the leapseconds and 
          SCLK kernels.  We will pretend that these files are named 
          &quot;leapseconds.ker&quot; and &quot;gllsclk.ker&quot;.  To use this code 
          fragment, you must substitute the actual names of these 
          kernel files for the names used here. 
 
             /.
             load leapseconds and sclk kernels: 
             ./
             <a href="furnsh_c.html">furnsh_c</a> ( &quot;leapseconds.ker&quot; ); 
             <a href="furnsh_c.html">furnsh_c</a> ( &quot;gllsclk.ker&quot;     ); 
 
             /.
             The mission is Galileo, which has spacecraft ID -77. 
             Let's assume that the SCLK string is 
 
                1 / 1900000:00:00 
 
             The number 1, followed by a slash, indicates that the 
             epoch is in the first partition. 
 
             The next step is to encode this SCLK string, and also 
             find the corresponding ET value: 
             ./
             
             <a href="scencd_c.html">scencd_c</a> ( -77, &quot;1/ 1900000:00:00&quot;, &amp;sclkdp ); 
             <b>sct2e_c</b>  ( -77,  sclkdp,            &amp;et     );
 
 
          We'll assume that you've already loaded SPK and CK files 
          containing ephemeris data for the GLL orbiter and the 
          Earth, as well as scan platform pointing.  Now you're 
          ready to call both <a href="ckgp_c.html">ckgp_c</a>, which expects the input epoch to 
          be specified by an encoded SCLK string, and <a href="spkez_c.html">spkez_c</a>, which 
          expects the epoch to be specified as an ephemeris time. 
 
             /.
             Find scan platform pointing cmat and s/c--target 
             vector (first 3 components of state) at epoch. 
             We assume that CK and SPK kernels have been loaded 
             already, via <a href="cklpf_c.html">cklpf_c</a> and <a href="spklef_c.html">spklef_c</a> respectively. 
             
             Use tolerance of 80 ticks for the CK look-up.
             ./
             scanpl = -77001; 
             earth  =    399;
             tol    =   80.0;

             <a href="ckgp_c.html">ckgp_c</a>  ( scanpl,  sclkdp,   tol,    refsys, 
                       cmat,    &amp;clkout,  &amp;found         ); 

             if ( !found )  
             {
                [ Indicate to user that pointing was not 
                  available ] 
             }

             <a href="spkez_c.html">spkez_c</a> ( earth,  et,     refsys,  corr, 
                       -77,    state,  &amp;lt           ); 


 
   2)  Convert an encoded Voyager 2 SCLK value to UTC, using calendar 
       format, with 3 digits of precision. 
 
          Again, your initialization code must load the leapseconds 
          and SCLK kernels: 
 
             /.
             load leapseconds and SCLK kernels: 
             ./
             <a href="furnsh_c.html">furnsh_c</a> ( &quot;leapseconds.ker&quot; );
             <a href="furnsh_c.html">furnsh_c</a> ( &quot;vgr2sclk.ker&quot;    );

 
          To find the UTC value corresponding to the encoded 
          Voyager 2 SCLK value sclkdp, you can use the code fragment 
 
             <b>sct2e_c</b>  ( -32,  sclkdp,     &amp;et          ); 
             <a href="et2utc_c.html">et2utc_c</a> (  et,  &quot;c&quot;,    3,  UTCLEN,  utc );

          where UTCLEN is a constant indicating the available
          room in the string utc.  A value of 25 characters suffices.
              
 </PRE>
<h4><a name="Restrictions">Restrictions</a></h4>
<PRE>
 
   1)  An SCLK kernel appropriate to the spacecraft clock identified 
       by SC must be loaded at the time this routine is called. 
 
   2)  If the SCLK kernel used with this routine does not map SCLK 
       directly to barycentric dynamical time, a leapseconds kernel 
       must be loaded at the time this routine is called. 
 </PRE>
<h4><a name="Literature_References">Literature_References</a></h4>
<PRE>
 
   [1]  CK Required Reading 
 
   [2]  SPK Required Reading 
 </PRE>
<h4><a name="Author_and_Institution">Author_and_Institution</a></h4>
<PRE>
 
   N.J. Bachman   (JPL) 
 </PRE>
<h4><a name="Version">Version</a></h4>
<PRE>
   -CSPICE Version 1.0.1, 14-AUG-2006   (EDW)

      Replace mention of <a href="ldpool_c.html">ldpool_c</a> with <a href="furnsh_c.html">furnsh_c</a>.

   -CSPICE Version 1.0.0, 08-FEB-1998 (NJB)
   
      Based on SPICELIB Version 1.0.2, 10-APR-1992 (NJB) (WLT)
</PRE>
<h4><a name="Index_Entries">Index_Entries</a></h4>
<PRE>
 
   spacecraft_clock ticks to ephemeris time 
 </PRE>
<h4>Link to routine sct2e_c source file <a href='../../../src/cspice/sct2e_c.c'>sct2e_c.c</a> </h4>

      </td>
    </tr>
  </tbody>
</table>

   <pre>Wed Jun  9 13:05:29 2010</pre>

</body>
</html>

